System multiplexing apparatus preventing overflow of audio decoder buffer

ABSTRACT

A time zone start time point calculating unit calculates a time zone to be set in a VOBU in accordance with audio bit rate. A time zone comparing unit compares a time point at which an audio pack is to be multiplexed with the time zone calculated by the time zone start time point calculating unit. A flag setting unit sets whether the audio pack is to be completed or not in accordance with the result of comparison by the time zone comparing unit. Therefore, a completing process takes place before a VOBU boundary, and a completed PCK will not be generated immediately after the VOBU boundary. Thus, generation of a buffer overflow can be prevented.

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The present invention relates to system multiplexing for formingone stream of digitally compressed image and audio data and, morespecifically, to a system multiplexing apparatus preventing an overflowof a buffer in an audio decoder.

[0003] 2. Description of the Background Art

[0004] Recently, along with performance improvement of semiconductordevices, methods of digitally compressing images and sounds have beenvigorously studied, and international standard specifications fordigital compression of images and sounds, including MPEG (Moving PictureExperts Group) specification, have been determined. In compliancetherewith, video recording and reproducing apparatuses for digital TVbroadcast, DVD (Digital Versatile Disc) and the like utilizing digitalcompression are becoming popular.

[0005] When moving images and sounds are to be handled simultaneously, aprocess referred to as system multiplexing is necessary, by whichdigitally compressed image and audio data are turned into one stream. Inthe system multiplexing process, image data and audio data are dividedinto small units, and the data are arranged in order considering amountsof data and time points of display and reproduction, to form onecollective stream.

[0006] Japanese Patent Laying-Open No. 8-98160 discloses a relatedtechnique. A data multiplexing apparatus disclosed in Japanese PatentLaying-Open No. 8-98160 includes a plurality of encoders encoding inputdigital sounds and moving images and outputting the result as an encodedstream, multiplexes a plurality of such encoded streams to enablesimultaneous reproduction, and the apparatus includes control means forperforming virtual decoding buffer simulation for each of the encodedstreams and outputting a multiplex request signal based on an amount ofoccupation by the data in the buffer, and multiplexing means formultiplexing each of the encoded streams based on the multiplex requestsignal.

[0007] In the data multiplexing apparatus disclosed in Japanese PatentLaying-Open No. 8-98160 mentioned above, virtual decoding buffersimulation is performed for each encoded stream and multiplexing is donebased on the amount of data occupation in the buffer. When audiocompleting of a VOBU (video object unit) boundary is performed, however,an overflow may occur undesirably in a buffer of an audio decoder, aswill be described later.

SUMMARY OF THE INVENTION

[0008] An object of the present invention is to provide a systemmultiplexing apparatus capable of reducing loss in multiplexing, whilepreventing an overflow in an audio buffer.

[0009] According to an aspect, the present invention provides a systemmultiplexing apparatus for outputting video and audio packs multiplexedwith each other, including a calculating unit calculating a time zone tobe set in a video object unit in accordance with audio bit rate, acomparing unit comparing a time point of multiplexing an audio pack withthe time zone calculated by the calculating unit, and a setting unitsetting whether the audio pack is to be completed or not, in accordancewith the result of comparison by the comparing unit.

[0010] The comparing unit compares the time point of multiplexing theaudio pack and the time zone calculated by the calculating unit, and thesetting unit sets whether the audio pack is to be completed or not inaccordance with the result of comparison by the comparing unit.Therefore, the completing process takes place before the VOBU boundary,a complete PCK is not generated immediately after the VOBU boundary, andtherefore, generation of a buffer overflow can be prevented.

[0011] The foregoing and other objects, features, aspects and advantagesof the present invention will become more apparent from the followingdetailed description of the present invention when taken in conjunctionwith the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

[0012]FIG. 1 is a block diagram representing schematic configurations ofa recorder and a reproducer, including the system multiplexingapparatus.

[0013]FIG. 2 shows an example of a PS configuration.

[0014]FIGS. 3A to 3C represent PCK configuration in compliance with DVDspecification.

[0015]FIG. 4 shows transition of audio buffer storage amount of adecoder.

[0016]FIG. 5 is a flow chart representing process steps performed by asystem multiplexing unit 5.

[0017]FIG. 6 is a flow chart representing details of step S13 shown inFIG. 5.

[0018]FIG. 7 represents relation of image recording mode, soundrecording mode, bit rate, frame length and PCK period.

[0019]FIG. 8 represents buffer transition when a virtual buffer controlmethod is applied to a mode in which one audio frame is long.

[0020]FIGS. 9A to 9D illustrate an example in which an overflow occursin an audio buffer.

[0021]FIG. 10 shows an exemplary solution to the problem illustrated inFIGS. 9A to 9D.

[0022]FIG. 11 is a flow chart representing a process for recognizing inadvance the VOBU boundary.

[0023]FIGS. 12A and 12B illustrate an example of calculation of videocomplete time point.

[0024]FIGS. 13A to 13H represent 8 variations generated dependent onwhether the last V_PCK time point of each picture exceeds a pictureperiod time or not.

[0025]FIG. 14 represents a functional configuration of the systemmultiplexing apparatus in accordance with the first embodiment of thepresent invention.

[0026]FIG. 15 is a flow chart representing process steps performed bythe system multiplexing apparatus in accordance with the firstembodiment of the present invention.

[0027]FIGS. 16A to 16D illustrate a complete zone applied in the systemmultiplexing apparatus in accordance with the first embodiment of thepresent invention.

[0028]FIG. 17 is a schematic illustration of a complete zone applied inthe system multiplexing apparatus in accordance with the firstembodiment of the present invention.

[0029]FIG. 18 illustrates a method of calculating a threshold value.

[0030]FIG. 19 illustrates a method of calculating a threshold value whenthe audio buffer has the capacity of 4.2Kbytes and A_ES included inA_PCK is 1.8Kbytes.

[0031]FIG. 20 illustrates audio buffer transition and an A_PCKconfiguration in the system multiplexing apparatus in accordance withthe first embodiment of the present invention.

[0032]FIG. 21 illustrates audio buffer transition and an A_PCKconfiguration in the system multiplexing apparatus in accordance withthe first embodiment of the present invention, with multiplexing lossreduced.

[0033]FIG. 22 illustrates audio buffer transition when VOBU completingprocess is forced immediately after an output of an ordinary PCK.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0034]FIG. 1 is a block diagram representing a schematic configurationof a recorder (encoder) and a reproducer (decoder), including a systemmultiplexing apparatus (hereinafter also referred to as a systemmultiplexing unit).

[0035] The recorder includes a video encoder 1 encoding image data, anaudio encoder 2 encoding audio data, a video buffer 3 temporally storingV-ES (Video-Elementary Stream) output from video encoder 1, an audiobuffer 4 temporally storing A-ES (Audio-Elementary Stream) output fromaudio encoder 2, and a system multiplexing unit 5 multiplexing V-ES andA-ES output from video buffer 3 and audio buffer 4 and outputting theresult as a PS (Program Stream).

[0036] The reproducer includes a system separating unit 6 separating thePS into V-ES and A-ES, a video buffer 7 temporally storing V-ESseparated by system separating unit 6, an audio buffer 8 temporallystoring A-ES separated by system separating unit 6, a video decoder 9decoding V-ES output from video buffer 7, and an audio decoder 10decoding A-ES output from audio buffer 8.

[0037]FIG. 2 illustrates an exemplary configuration of PS. PS consistsof VOBUs. Each VOBU includes Audio, Video and RDI (Real time DataInformation) PCKs, beginning with RDI_PCK and ending with completedV_PCK (Vc) and A_PCK (Ac).

[0038] According to DVD-Video Recording specification (hereinafterreferred to as DVD specification), a completing process for completingimages and sounds in a frame unit is necessary for each VOBU (GOP (GroupOf Pictures): a unit of about 15 pictures). The completing process is aprocess to fill ES shortage of a PCK of 2KB (2048bytes) with a stuff orpadding.

[0039]FIGS. 3A to 3C represent a PCK configuration in compliance withthe DVD specification. FIG. 3A represents an ordinary PCK configurationthat includes a Pack Header of 14 bytes, a Packet Header of 14 bytes,and ES of 2020 bytes.

[0040]FIG. 3B represents a VOBU complete PCK with a stuff inserted,which includes Pack Header of 14 bytes, Packet Header of 14 bytes, Stuffof 1 to 7 bytes and ES of an arbitrary length.

[0041]FIG. 3C represents a configuration of a VOBU complete PCK with apadding, which includes Pack Header of 14 bytes, Packet Header of 14bytes, ES of an arbitrary length, and Padding Packet of at least 8bytes.

[0042] In video encoding in accordance with the DVD specification or thelike that involves VBR (Variable Bit Rate) control, the amount of codesfor one picture is not constant, and a VOBU boundary appears at any timepoint dependent on the video code amount.

[0043] Further, different conditions for system multiplexing are definedas specifications for different applications, as can be seen from thefact that specification of DVD-Video for reproduction only differs fromthe specification of DVD-VR for both recording and reproduction.According to the DVD specification, the size of an audio buffer of adecoder is defined to be 4 KB.

[0044]FIG. 4 shows a transition of the amount of storage in the audiobuffer of the decoder. When a PCK is output from system separating unit6, data is input to audio buffer 8 (amount of storage increases), and ata decode time point for every frame period, data is output to audiodecoder 10 (amount of storage decreases). To realize control (audiobuffer control) that prevents any overflow/underflow while inputting PCKof 2KB into audio buffer 8 of 4KB, the amount of storage is changed with2KB being the center.

[0045] For this purpose, virtual buffer remaining capacity is calculatedassuming that data is drawn out from audio buffer 8 at a constant rate,and when the virtual buffer remaining capacity reaches 1KB, the next PCKis output from system separating unit 6, as shown in FIG. 4. This methodwill be referred to as virtual buffer control method in the following.

[0046]FIG. 5 is a flow chart representing process steps performed bysystem multiplexing unit 5. System multiplexing unit 5 confirms whetherV_ESs sufficient to form one PCK exist in video buffer 3 or not (S11).When there are sufficient V_ESs in video buffer 3, system multiplexingunit 5 determines which one of the PCK configurations shown in FIGS. 3Ato 3C is to be employed (S12).

[0047] Thereafter, system multiplexing unit 5 determines whether VOBUboundary is recognized and a complete PCK is formed, in the video PCKconfiguration, and determines whether an audio PCK should also becompleted or not (S13). Details of this step will be described later.

[0048] Next, as in the case of V_ES, system multiplexing unit 5 confirmswhether A_ESs sufficient to form one PCK exist in audio buffer 4 or not(S14). When there are sufficient A_ESs in audio buffer 4, systemmultiplexing unit 5 determines which one of the PCK configurations shownin FIGS. 3A to 3C is to be employed (S15).

[0049] Then, system multiplexing unit 5 determines whether a video PCKor an audio PCK is to be output (S16). Finally, system multiplexing unit5 outputs the selected video PCK or audio PCK (S17).

[0050]FIG. 6 is a flow chart representing the details of the processstep S13 shown in FIG. 5. First, system multiplexing unit 5 determineswhether the video PCK configuration is a complete PCK or not (S21). Whenthe video PCK is a complete PCK (S21, YES), the next audio PCK isdetermined to be a complete PCK, and an audio complete flag is set to 1(S22). When the video PCK is not a complete PCK (S21, NO), the nextaudio PCK is determined not to be a complete PCK, and the audio completeflag is set to 0 (S23). In the following, this method will be referredto as VOBU boundary forced complete method.

[0051]FIG. 7 represents relation between each of image recording mode,sound recording mode, bit rate, frame length and PCK period in AC-3. Byway of example, when the image recording mode is “high quality” and thesound recording mode is 11, the bit rate is 384 kbps, the frame lengthis 1536 bytes, and the PCK period is 3788 SCR.

[0052]FIG. 8 shows buffer transition when the virtual buffer controlmethod is applied to a mode in which one audio frame is long, forexample the high quality mode (with bit rate of 384 kbps and framelength of 1536 bytes) of FIG. 7. The decoder controls the amount ofstorage with the buffer storage amount of 2KB regarded as the center. Inthis example, however, the amplitude to the upper and lower sidesbecomes large, resulting in undesirably small margin for the upper andlower limits of audio buffer 8.

[0053] In such a virtual buffer control method, when the audio framelength is long and the completing process at the VOBU boundary that isunpredictable occurs while the buffer has large amount of storage, anoverflow is likely.

[0054]FIGS. 9A to 9D illustrate an occurrence of an overflow in theaudio buffer. FIG. 9A represents a V_ES having the picture period of3003 SCR. FIG. 9B represents an A_ES having the audio frame length of1536 bytes and the frame period of 2880 SCR. FIG. 9C represents a PShaving an audio PCK period of 3840 SCR. FIG. 9D represents buffertransition of audio buffer 8 of the decoder.

[0055] As can be seen from FIG. 9C, when a VOBU boundary occurs, acomplete PCK is generated. Therefore, occurrence of the VOBU when theamount of storage in the audio buffer is large may cause a bufferoverflow.

[0056]FIG. 10 represents an exemplary solution to the problem describedwith reference to FIGS. 9A to 9D. As shown in FIG. 10, when all audioPCKs are completed, it becomes unnecessary to generate any new completePCK at an occurrence of the VOBU boundary, and therefore, a bufferoverflow can be prevented. It is noted, however, that the stuff orpadding inserted to the complete PCK is meaningless data, and therefore,this solution leads to a problem of lower efficiency of multiplexing.

[0057] As a method of preventing buffer overflow without degradingefficiency of multiplexing, a method has been known in which the VOBUboundary is recognized in advance in an audio complete determiningprocess. FIG. 11 is a flow chart representing the process forrecognizing the VOBU boundary in advance. This process corresponds tostep S13 of FIG. 5. Further, FIGS. 12A and 12B illustrate examples ofcalculation of the video complete time point. In the following, theprocess for recognizing in advance the VOBU boundary shown in FIG. 11will be described.

[0058] First, system multiplexing unit 5 calculates, from the codeamount of Video-ES of a picture (picture (n-2)) preceding the lastpicture of the VOBU by two frames, how many V_PCKs are included therein,and calculates the last V_PCK time point of the picture (n-2) (S31).

[0059] Thereafter, in the similar manner, the last V_PCK time point ofpicture (n-1) is calculated (S32), and the last V_PCK time point ofpicture (n) is calculated (S33). Then, system multiplexing unit 5tentatively holds the last V_PCK time point of picture (n) as the videocomplete time point (S34).

[0060] Referring to FIG. 12A, when the video complete time point ofpicture (n) is earlier than the last time point of picture (n) (pictureperiod time), the last time point of picture (n) is set as the videocomplete time point. When the video complete time point of picture (n)exceeds the last time point of picture (n), the time point is set as thevideo complete time point.

[0061] In the examples shown in FIGS. 12A and 12B, the last V_PCK timepoints of pictures (n-2) and (n-1) exceed the picture period time. Whenthe video code amount (number of PCKs) of one picture is smaller thanthe number of PCKs that can be transmitted within one picture time, itis necessary to set the picture period time as the last V_PCK time pointof the picture, and when the number of PCKs of one picture is largerthan the number of PCKs that can be transmitted within one picture time,it is necessary to set the time point calculated from the number of PCKsas the last V_PCK time point of the picture.

[0062] Here, the time by which the last V_PCK time point exceeds thepicture period time will be the start time point of the next picture.Therefore, dependent on whether the last V_PCK time point of respectivepictures exceed the picture period time or not, as determined by thecode amounts of pictures (n-3), (n-2) and (n-1), there would be eightvariations.

[0063]FIGS. 13A to 13H illustrate the eight variations generateddependent on whether the last V_PCK time point of respective picturesexceeds the picture period time or not. For example, FIG. 13A shows anexample in which the last V_PCK time points of pictures (n-2), (n-1) and(n) exceed the picture period time, respectively. FIG. 13C shows anexample in which the last V_PCK time point of picture (n-2) exceeds thepicture period time, the last V_PCK time point of picture (n-1) iswithin the picture period time, and the last V_PCK time point of picture(n) exceeds the picture period time.

[0064] As can be seen from the foregoing, in order to calculate thevideo complete time point, many situations must be taken intoconsideration, and hence a complicated process is necessary to recognizein advance the VOBU boundary.

[0065] In the following, a system multiplexing apparatus that improvesefficiency of multiplexing while suppressing increase in time necessaryfor the audio completing process will be described.

[0066] First Embodiment

[0067] Schematic configuration of the encoder and decoder including thesystem multiplexing apparatus in accordance with the first embodiment ofthe present invention is the same as that of FIG. 1. Therefore,overlapping descriptions of the configuration and functions will not berepeated.

[0068]FIG. 14 represents a functional configuration of the systemmultiplexing apparatus in accordance with the first embodiment of thepresent invention. The system multiplexing apparatus includes a timezone start time point calculating unit 11 calculating a start time pointof a time zone having a possible completing (hereinafter also referredto as a complete zone), a time zone comparing unit 12 comparing a timepoint at which an audio PCK is to be multiplexed with the time zonestart time point calculated by time zone start time point calculatingunit 11, and a flag setting unit 13 setting an audio complete flag inaccordance with the result of comparison by the time zone comparing unit12. The functional configuration shown in FIG. 14 may be implemented bya CPU (Central Processing Unit) executing a prescribed program, or itmay be implemented by hardware.

[0069]FIG. 15 is a flow chart representing the process steps performedby the system multiplexing apparatus in accordance with the firstembodiment of the present invention. The system multiplexing apparatusof the present embodiment is conceived noticing that A_PCK is alwaysoutput at least once in one period of A_PCK.

[0070] First, time zone start time point calculating unit 11 calculatesthe complete zone from the PCK period that is derived with reference tothe audio bit rate (S41). Thereafter, time zone comparing unit 12compares the time point at which the audio PCK is to be multiplexed(hereinafter referred to as the SCR time point) with the time zone starttime point, and determines whether the time point at which the audio PCKis to be multiplexed is within the time zone (S42).

[0071] When the time point at which the audio PCK is to be multiplexedis within the time zone (S42, YES), flag setting unit 13 sets the audiocomplete flag to 1, and generates a complete PCK (S43). When the timepoint at which the audio PCK is to be multiplexed is not within the timezone (S42, NO), flag setting unit 13 sets the audio complete flag to 0,and generates an ordinary A_PCK (S44). It is noted that the start pointof the complete zone is the GOP boundary time point.

[0072] The audio bit rate is determined, for example, by a user settingthe image recording (sound recording) mode. Though it also depends onthe product specification of the DVD recorder, the sound recording modeshown in FIG. 7 itself may be set, or the sound recording mode may beselected by switching between the high quality (shorttime)/standard/long time mode.

[0073] The complete zone start time point is calculated, backward fromthe GOP boundary time point, by using a time zone in which at least oneA_PCK surely exists, that is, by using the audio PCK period. The SCRtime point per 1 byte will be given by the following.

[0074] SCR time point per 1 byte=(8bits/bit rate×90 KHz) . . . (1)

[0075] When the bit rate is 384 kbps, the SCR time point per 1 byte willbe given by the following, in SCR time point equivalent.

[0076] SCR time point per 1 byte=8bits/384 kbps×90 KHz=720/384 SCR=1.875SCR . . . (2)

[0077] It is assumed that the ES amount in one PCK corresponds to thePCK length of 2048 bytes with PS header and PES header subtracted. Whenthe ES amount is assumed to be 2020 bytes as shown in FIG. 3A, theperiod of one PCK will be

[0078] Period of 1 PCK=1.875 SCR/byte×2020 bytes=3787.5 SCR . . . (3)

[0079] Therefore, the complete zone is rounded up to 3788 SCR.

[0080]FIGS. 16A to 16D illustrate the complete zone applied in thesystem multiplexing apparatus in accordance with the first embodiment.FIGS. 16A and 16B are similar to FIGS. 9A and 9B, and therefore,detailed description thereof is not repeated. As can be seen from FIG.16C, the complete zone is from a time point preceding by one A_PCKperiod from the GOP boundary time point until the VOBU boundary timepoint. In the example of FIG. 16C, two complete A_PCKs are generated.

[0081]FIG. 16D represents transition of storage amount of the audiobuffer. As shown in FIG. 16D, as the completing process takes placebefore the VOBU boundary, a complete A_PCK is not generated immediatelyafter the VOBU boundary, and therefore, generation of a buffer overflowcan be prevented.

[0082]FIG. 17 is a schematic illustration of the complete zone appliedin the system multiplexing apparatus in accordance with the firstembodiment of the present invention. It can be seen that two completePCKs are generated in the complete zone.

[0083] As described above, in the system multiplexing apparatus inaccordance with the first embodiment of the present invention, acomplete zone using the GOP boundary time point as a start point iscalculated, and when a time point at which an audio PCK is to bemultiplexed is within the complete zone, the audio PCK is completed.Therefore, it becomes possible to improve efficiency of multiplexing byreducing multiplexing loss caused by insertion of a padding or stuff,while preventing generation of an overflow of the audio buffer.

[0084] Second Embodiment

[0085] In the first embodiment of the present invention, complete zonesare provided for all the bit rates, and dependent on whether the timepoint at which an audio PCK is to be multiplexed is within a completezone or not, an A_PCK is completed. When the code length is so short asto cause no overflow of the audio buffer with the use of the virtualbuffer control method only, the above described approach rather lowersthe efficiency of multiplexing.

[0086] In the second embodiment, whether the time zone complete methodin accordance with the first embodiment is to be applied or not isdetermined in accordance with audio frame length. The configuration ofthe encoder including the system multiplexing apparatus and thefunctional configuration of the system multiplexing apparatus inaccordance with the present embodiment are the same as the configurationof the encoder shown in FIG. 1 and the functional configuration of thesystem multiplexing apparatus shown in FIG. 14 in accordance with thefirst embodiment. Therefore, overlapping description of theconfigurations and functions will not be repeated.

[0087] When the audio frame length is equal to or longer than athreshold value, the completing process is performed using the abovedescribed time zone complete method. When the audio frame length isshorter than the threshold value, the completing process is performedusing the VOBU boundary forced complete method.

[0088] When the audio buffer has the capacity of 4 Kbytes and theremaining capacity of the buffer is to be controlled using 2 Kbytes as acentral value as in a system multiplexing apparatus in compliance withthe DVD specification, the threshold value of the audio frame length isset to 1024 bytes.

[0089]FIG. 18 is an illustration of the method of calculating thethreshold value described above. At the center of the storage amount ofthe 4Kbyte audio buffer, a PCK of 2 Kbytes is placed, and a differencebetween the upper end thereof and the upper limit of the buffer (1024byte) is used as the threshold value. The reason for this is as follows.The storage amount of the audio buffer changes with 2 Kbytes being thecenter, and therefore, even when a VOBU boundary appears immediatelyafter an output of A_PCK of 2 Kbytes and the completing process takesplace, what results is simply a storage of data corresponding to theaudio frame length in the audio buffer.

[0090]FIG. 19 is an illustration of the method of calculating thethreshold value when the audio buffer has the capacity of 4.2 Kbytes andan A_ES included in an A_PCK is 1.8 Kbytes. At the center (2.1 Kbytes)of the storage amount of the 4.2 Kbytes audio buffer, a PCK of 1.8Kbytes is placed, and a difference between the upper end thereof and theupper limit of the buffer (1.2 Kbytes) is used as the threshold value.

[0091] As described above, in the system multiplexing apparatus inaccordance with the present embodiment, the time zone complete methodand the VOBU boundary forced complete method are switched dependent onwhether the audio frame length is not shorter than the threshold valueor not. Therefore, lowering of the efficiency of multiplexingexperienced when the audio frame length is short can be avoided.

[0092] Third Embodiment

[0093] In the first embodiment, the process for calculating the completezone in accordance with the bit rate is necessary, and in the secondembodiment, a process for switching the methods by comparing the audioframe length with a threshold value is necessary. Therefore, in eithermethod, process time becomes longer.

[0094] In the third embodiment of the present invention, the worst(longest) complete zone employed in a product is set in advance, so asto improve speed of processing. The configuration of the encoderincluding the system multiplexing apparatus and the functionalconfiguration of the system multiplexing apparatus in accordance withthe present embodiment are the same as the configuration of the encodershown in FIG. 1 and the functional configuration of the systemmultiplexing apparatus shown in FIG. 14 in accordance with the firstembodiment. Therefore, overlapping description of the configurations andfunctions will not be repeated.

[0095] By way of example, assume that the product bit rate of up to 192Kbps is supported. In that case, the time zone start time point is 7575SCR earlier than the GOP boundary. This value is set in advance in thesystem multiplexing apparatus, and the completing process is performedusing this value regardless of the bit rate. Though AC-3 only is shownin FIG. 7, the present invention is also applicable to other Audio typesuch as MPEG-1Audio.

[0096] As described above, in the system multiplexing apparatus inaccordance with the present embodiment, the completing process isperformed using a time zone start time point set in advance, andtherefore, speed of processing of the system multiplexing apparatus canbe improved.

[0097] Fourth Embodiment

[0098] In the first embodiment, when the time point is within thecomplete time zone, the completing process is performed even if theactual storage amount of the buffer is small and the completing processis unnecessary, causing multiplexing loss. In the present embodiment,whether the completing process is necessary or not is determined toreduce the multiplexing loss. The configuration of the encoder includingthe system multiplexing apparatus in accordance with the presentembodiment is the same as the configuration of the encoder in accordancewith the first embodiment shown in FIG. 1. The functional configurationof the system multiplexing apparatus of the present embodiment differsfrom the functional configuration of the system multiplexing apparatusshown in FIG. 14 only in that the flag setting unit additionally has afunction of calculating the remaining capacity of the audio buffer.Therefore, overlapping description of the configurations and functionswill not be repeated. In the present embodiment, the flag setting unitwill be denoted by the reference character 13′.

[0099]FIG. 20 illustrates transition of the audio buffer of the systemmultiplexing apparatus and the configuration of A_PCK in accordance withthe first embodiment of the present invention. As can be seen from FIG.20, four A_PCKS, of which time point to multiplex the audio PCK iswithin the complete time zone, will be completed.

[0100]FIG. 21 illustrates transition of the audio buffer of the systemmultiplexing apparatus and the configuration of A_PCK in accordance withthe first embodiment of the present invention, with the multiplexingloss reduced. As can be seen from FIG. 21, even when the first twoA_PCKs within the time zone are not completed, no overflow occurs in theaudio buffer.

[0101] In the system multiplexing apparatus in accordance with thefourth embodiment of the present invention, flag setting unit 13′calculates increase in the amount of storage of the buffer caused by theESs in the PCKs output from the start of multiplexing and the amount ofdata drawn out from the audio buffer at the PTS (decode time point), andcalculates the amount of storage of the audio buffer.

[0102] When it is determined by time zone comparing unit 12 that the SCRtime point is within the time zone, flag setting unit 13′ refers to theactual remaining capacity of the audio buffer, and determines whether abuffer overflow can be avoided even when an uncompleted, ordinary PCK isoutput and thereafter a complete PCK is continuously output. When it isdetermined that an overflow can be avoided, flag setting unit 13′ setsthe audio complete flag to 0, and outputs an ordinary A_PCK.

[0103] When it is determined that an overflow will occur, flag settingunit 13′ sets the audio complete flag to 1, and outputs a completeA_PCK.

[0104]FIG. 22 represents audio buffer transition when the VOBUcompleting process is forced immediately after an output of an ordinaryPCK. Here, whether the A_PCK is to be completed or not is determined byactually calculating the remaining capacity of the buffer, andtherefore, an overflow does not occur in the audio buffer even when theVOBU completing process is forced immediately after the output of anordinary PCK.

[0105] As described above, in the system multiplexing apparatus inaccordance with the present embodiment, whether an A_PCK is to becompleted or not is determined by calculating remaining capacity of theaudio buffer. Therefore, generation of an unnecessary completed PCK canbe avoided and the efficiency of multiplexing can be improved.

[0106] Although the present invention has been described and illustratedin detail, it is clearly understood that the same is by way ofillustration and example only and is not to be taken by way oflimitation, the spirit and scope of the present invention being limitedonly by the terms of the appended claims.

What is claimed is:
 1. A system multiplexing apparatus outputting avideo pack and an audio pack multiplexed with each other, comprising: acalculating unit calculating a time zone to be set in a video objectunit, in accordance with audio bit rate; a comparing unit comparing atime point of multiplexing the audio pack with the time zone calculatedby said calculating unit; and a setting unit setting whether the audiopack is to be completed or not in accordance with the result ofcomparison by said comparing unit.
 2. The system multiplexing apparatusaccording to claim 1, wherein said calculating unit defines the timezone from a time point earlier by an audio pack period than agroup-of-picture boundary time point to said video object unit boundarytime point.
 3. The system multiplexing apparatus according to claim 1,wherein said setting unit sets, when audio frame length is not shorterthan a prescribed value, whether the audio pack is to be completed ornot in accordance with a result of comparison by said comparing unit andsaid setting unit sets, when said audio frame length is shorter than theprescribed value, forced completing of the audio frame immediately aftersaid video object unit boundary time point.
 4. The system multiplexingapparatus according to claim 1, wherein said setting unit calculatesaudio buffer remaining capacity, determines whether a buffer overflowoccurs or not if an uncompleted audio pack is output, and determineswhether the audio pack is to be completed or not.
 5. A systemmultiplexing apparatus outputting a video pack and an audio packmultiplexed with each other, comprising: a comparing unit comparing atime point of multiplexing the audio pack with a time zone set inadvance in a video object unit; and a setting unit setting whether theaudio pack is to be completed or not in accordance with the result ofcomparison by said comparing unit.
 6. The system multiplexing apparatusaccording to claim 5, wherein said setting unit calculates audio bufferremaining capacity, determines whether a buffer overflow occurs or notif an uncompleted audio pack is output, and determines whether the audiopack is to be completed or not.